<template>
    <div class="app-container">
      <h4>客户个人信息</h4>
      <table
        class="table table-striped table-condenseda table-bordered"
        width="100%"
      >
        <tbody>
          <tr>
            <th width="10px">客户姓名</th>
            <td whidth="10px">{{ clientInfo.name }}</td>

            <th width="15%">性别</th>
            <td width="35%">
              <b v-if="clientInfo.sex == 0">女</b>
              <b v-if="clientInfo.sex == 1">男</b>
            </td>
            
          </tr>
          <tr>
            <th>登录账号</th>
            <td>{{ clientInfo.number }}</td>
            <th>手机号</th>
            <td>
              {{ clientInfo.mobile }}
            </td>
          </tr>
          <tr>
            <th>积分</th>
            <td>{{ clientInfo.integral }}</td>
            <th>身份证</th>
            <td>
              <b>{{ clientInfo.identityCard }}</b>
            </td>
          </tr>
          <tr>
            <th>账号等级</th>
            <td>
              <b v-if="clientInfo.accountLevel == 0">普通用户</b>
              <b v-if="clientInfo.accountLevel == 1">VIP用户</b>
            </td>
            <th>是否投资商</th>
            <td>
              <b v-if="clientInfo.investor == 0">否</b>
              <b v-if="clientInfo.investor == 1">是</b>
            </td>
          </tr>
          <tr>
            <th>头像</th>
            <td>
                <el-image
                    style="width: 150px;"
                    :src="clientInfo.picture"
                    :preview-src-list="[clientInfo.picture]"
                  />
            </td>
             <th>居住地址</th>
             <td>{{ clientInfo.address}}</td>
          </tr>
        </tbody>
      </table>

      <el-row style="text-align:center;margin-top: 40px;">
        <el-button @click="back">
          返回
        </el-button>
      </el-row>
    </div>
  </template>
<script>
  import '@/styles/show.css'

  import ClientApi from '@/api/charging-pile/cilent'
  
    export default {

    data() {

      return {
        clientInfo:{},
        //dealInfo:{},
        // lendItemList: [], //投资列表
        // lendReturnList: [], //还款计划列表
       //dealRank:0,
      }
    },
  
    created() {
      console.log(this.$route.params.id)
         if (this.$route.params.id) {
            this.findClientById()
         }
    },
  
    methods: {
        //查询条件
      findClientById() {
        ClientApi.findClientById(this.$route.params.id).then(res => {
          console.log(res);
          this.clientInfo = res.data.list
          //console.log(fjhgdjkgh);
        })
      },
  
      back() {
        this.$router.push({ path: '/charging-pile/client' })
      },
    }
  }
  </script>